package com.czbank.financing.service.impl;

import com.czbank.financing.Entity.UserInfo;
import com.czbank.financing.mapper.LoginMapper;
import com.czbank.financing.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther: thinkpad
 * @Date: 2019/7/11 11:11
 * @Description:
 */
@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public boolean existAccount(String account) {
        int count = loginMapper.existAccount(account);
        if(count==0) {
            return false;
        }
        else {
            return true;
        }
    }

    @Override
    public UserInfo Login(String account, String password) {
        UserInfo userInfo = loginMapper.findByAccountAndPassword(account, password);

        return userInfo;
    }
}
